package com.cloud.force.api.web;

import com.cloud.force.api.service.RecForceService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

/**
 * @program: quokka-server
 * @description: force 对外接口
 * @author: sl
 * @create: 2019-07-04 13:53
 **/
@RestController
@RequestMapping("force/interface/")
public class ForceInterfaceController {

    @Autowired
    private RecForceService recForceService;

    /**
     * 案件指数  时 日 周 月  for screen
     * @param start
     * @param end
     * @param unitCode
     * @param type
     * @return
     */
    @RequestMapping("getRecForceByDate")
    public List<Map<String, Object>> getRecForceByDate(String start , String end, String unitCode, Integer type, Integer recType) {
        return recForceService.getRecForceByDate(start, end, unitCode,type,recType);
    }

    /**
     * 案件问题来源  for screen
     * @param start
     * @param end
     * @param unitCode
     * @return
     */
    @RequestMapping("getLegalCaseSource")
    public List<Map<String, Object>> getLegalCaseSource(String start , String end, String unitCode,Integer recType) {
        return recForceService.getLegalCaseSource(start, end, unitCode,recType);
    }

    /**
     * 案件区域分布  for screen
     * @param start
     * @param end
     * @param unitCode
     * @return
     */
    @RequestMapping("getLegalCaseRegion")
    public List<Map<String, Object>> getLegalCaseRegion(String start , String end, String unitCode,String regionCode,Integer recType) {
        return recForceService.getLegalCaseRegion(start, end, unitCode,regionCode,recType);
    }
    /**
     * 案件top5  for screen
     * @param start
     * @param end
     * @param unitCode
     * @return
     */
    @RequestMapping("getLegalCaseDomain")
    public List<Map<String, Object>> getLegalCaseDomain(String start , String end, String unitCode,Integer recType) {
        return recForceService.getLegalCaseDomain(start, end, unitCode,recType,5);
    }

    /**
     * 大屏首页悬浮栏
     * @param start
     * @param end
     * @return
     */
    @RequestMapping("getLegalCaseGeneral")
    public Map<String, Object> getLegalCaseGeneral(String start , String end, String unitCode) {
        return recForceService.getLegalCaseGeneral(start, end ,unitCode);
    }

    /**
     * 法律法规
     * @return
     */
    @RequestMapping("getLawCaseTop5")
    public List<Map<String, Object>> getLawCaseTop5(String start , String end, String unitCode,Integer recType) {
        return recForceService.getLawCaseTop5(start, end, unitCode,recType);
    }

    /**
     * 法律法规
     *
     * @return
     */
    @RequestMapping("getLawCaseTop")
    public List<Map<String, Object>> getLawCaseTop(String start, String end, String unitCode, Integer num) {
        return recForceService.getLawCaseTop(start, end, unitCode, num);
    }


    /**
     * 法律法规
     *
     * @return
     */
    @RequestMapping("getLawUseStat")
    public List<Map<String, Object>> getLawUseStat(String start, String end, String unitCode) {
        return recForceService.getLawUseStat(start, end, unitCode);
    }

    @RequestMapping("getCauseUseStat")
    public List<Map<String, Object>> getCauseUseStat(String start, String end, String unitCode, String lawID) {
        return recForceService.getCauseUseStat(start, end, unitCode, lawID);
    }

    /**
     * 根据regionCode查询所有已有违法事实的行政强制
     * @return
     */
    @RequestMapping("getBasisCodeByRegionCode")
    public List<Map<String, Object>> getBasisCodeByRegionCode(String start, String end,String unitCode,Long regionid) {
        return recForceService.getBasisCodeByRegionCode(start,end,unitCode,regionid);
    }

    /**
     * 页面改版 执法信息统计
     */
    @RequestMapping("getLawDynamicsInfo")
    public Map<String, Object> getLawDynamicsInfo( String unitCode) {
        return recForceService.getLawDynamicsInfo(unitCode);
    }

    /**
     * 行政强制部门数量
     * @param start
     * @param end
     * @param unitCode
     * @return
     */
    @RequestMapping("getForceByRegionId")
    public List<Map<String, Object>> getForceByRegionId(String start, String end,String unitCode,Integer recType) {
        return recForceService.getForceByRegionId(start,end,unitCode,recType);
    }
    /**
     * 获取任务号
     * @param recTypeId
     * @return
     */
    @RequestMapping("calculate")
    public String calculate(String recTypeId){
        return recForceService.calculate(recTypeId);
    }
}
